package cn.shiwei.quartz.service.impl;

import cn.shiwei.quartz.service.IQuartzService;
import cn.shiwei.quartz.util.QuartzUtil;
import org.quartz.Scheduler;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.Date;

@Service
public class QuartzServiceImpl implements IQuartzService {

    @Autowired
    private Scheduler scheduler;

    @Override
    public void addRoderExpireJob(String jobName, Class cls, Object params, Date excuteTime) {

        QuartzUtil.addJob(
                scheduler,
                jobName,
                cls,
                params,
                excuteTime);

    }
}
